﻿using System;
using System.Xml.Serialization;
using cndp.Model.IModel;

namespace cndp.Model
{

    #region PlatformStruct

    [Serializable]
    public struct Platform
    {
        [XmlElement("STRAIGHT")]
        public double Straight { get; set; }

        [XmlElement("PIKE")]
        public double Pike { get; set; }

        [XmlElement("TUCK")]
        public double Tuck { get; set; }

        [XmlElement("FREE")]
        public double Free { get; set; }
    }

    #endregion
    /// <summary>
    /// Jump - Denna klass representarar ett hopp. Den innehåller dem olika kombinationer av stil och höjd som existerar.
    /// </summary>
    [Serializable]
    public class Jump : IJump
    {
        #region Constructor

        public Jump(int jumpId, string jumpName, double straightOneMeter, double pikeOneMeter, double tuckOneMeter,
            double freeOneMeter, double straightThreeMeter, double pikeThreeMeter, double tuckThreeMeter,
            double freeThreeMeter, double straightFiveMeter, double pikeFiveMeter, double tuckFiveMeter,
            double freeFiveMeter, double straightSevenMeter, double pikeSevenMeter, double tuckSevenMeter,
            double freeSevenMeter, double straightTenMeter, double pikeTenMeter, double tuckTenMeter,
            double freeTenMeter)
        {
            JumpId = jumpId;
            JumpName = jumpName;
            OneMeter.Straight = straightOneMeter;
            OneMeter.Pike = pikeOneMeter;
            OneMeter.Tuck = tuckOneMeter;
            OneMeter.Free = freeOneMeter;
            ThreeMeter.Straight = straightThreeMeter;
            ThreeMeter.Pike = pikeThreeMeter;
            ThreeMeter.Tuck = tuckThreeMeter;
            ThreeMeter.Free = freeThreeMeter;
            FiveMeter.Straight = straightFiveMeter;
            FiveMeter.Pike = pikeFiveMeter;
            FiveMeter.Tuck = tuckFiveMeter;
            FiveMeter.Free = freeFiveMeter;
            SevenMeter.Straight = straightSevenMeter;
            SevenMeter.Pike = pikeSevenMeter;
            SevenMeter.Tuck = tuckSevenMeter;
            SevenMeter.Free = freeSevenMeter;
            TenMeter.Straight = straightTenMeter;
            TenMeter.Pike = pikeTenMeter;
            TenMeter.Tuck = tuckTenMeter;
            TenMeter.Free = freeTenMeter;
        }

        public Jump()
        {
        }

        #endregion

        #region Variabels/Properties

        [XmlElement("FIVE_METER_PLATFORM")] public Platform FiveMeter;
        [XmlElement("ONE_METER_PLATFORM")] public Platform OneMeter;
        [XmlElement("SEVEN_METER_PLATFORM")] public Platform SevenMeter;
        [XmlElement("TEN_METER_PLATFORM")] public Platform TenMeter;
        [XmlElement("THREE_METER_PLATFORM")] public Platform ThreeMeter;

        [XmlElement("JUMP_ID")]
        public int JumpId { get; set; }

        [XmlElement("JUMP_NAME")]
        public string JumpName { get; set; }

        #endregion
    }
}